<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>开灯关灯</title>

	</head>
	<body>
		<img src="../picture/c5/pic_bulboff.gif" id="p1"/>
		
        <script type="text/javascript">
        	/*实现效果：点击图片：切换图片
        	  步骤：1、找到html元素，2、改变元素对象（修改src）*/
            var p1=document.getElementById('p1');
            //点击事件
            p1.onclick=function(){
            	//判断是否
            	if (p1.src.indexOf("off")!==-1) {
            		p1.src="../picture/c5/pic_bulbon.gif";
            	} else{
            		p1.src="../picture/c5/pic_bulboff.gif"
            	}
            	
            }
				
        
        </script>	
	</body>
</html>
